#pragma once

#include "MeshFactory.h"
#include "DX11Includes.h"
#include "Random.h"

class AssetManagment
{
public:
	AssetManagment(void);
	~AssetManagment(void);
	IMesh* LoadModel(const char* scenePath ,const char* meshName, MeshTypeData meshType = MeshTypeData::PositionTextureNormal, unsigned char ModelType = MODEL_XMLModel ,bool cacheLoadedModel = true);
	ID3D11ShaderResourceView* LoadTexture(const char* textureName);
	HRESULT CompileShaderFromFile( const char* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut , bool cacheLoadedShader = false, bool CanLookInTheCache = true);
	char*  LoadCompiledShader(const char* FileName ,SIZE_T* size,bool cacheLoadedShader = true , bool CanLookInTheCache =true);
	SceneElements* LoadScene(const char* scenePath ,SceneType = SceneType::GENERIC ,bool cacheLoadedScene = true,bool KeepModelDateInRam = false);
	IMesh* LoadAssimpSingleModel(const char* scenePath, bool cacheLoadedModel = true,bool KeepModelDateInRam = false);
	BitmapFileData* LoadBitmapData(const char* fielName);
	ID3D11ShaderResourceView * ColorTexture(int textureWidth, int textureHeight, float r, float g, float b,float a = 1);
	ID3D11ShaderResourceView * RandomTexture1D(int textureWidth);
private:
	MeshFactory* m_factory;
};
